//
//  ViewController.m
//  02-UIImageViewAnimation
//
//  Created by dllo on 16/7/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (nonatomic,strong) UIView *subView;
@end

@implementation ViewController
//loadView 加载UIViewController中的view
//UInavigation UITableViewController在loadView中给重写赋值了


//- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//{
////    初始化方法
//    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    if (self) {
////        不要再这个方法中，去加载视图
////        在这个方法中去初始化一些数据相关内容
//    }
//}













//- (void)loadView
//{
//    [super loadView];
//    NSLog(@"loadView");
//    
//
////    改变self.view
//}
//已经加载
//所有自定义视图的创建
- (void)loadView
{
    self.view.backgroundColor = [UIColor redColor];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
//    NSLog(@"viewDidLoad");
//    self.view = nil;
//    NSLog(@"%@",self.view);
    
    
//    模态
//    self.view.backgroundColor = [UIColor redColor];
//    UIButton *button = [UIButton buttonWithType:<#(UIButtonType)#>];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    
//    UIModalTransitionStyleCoverVertical 从上到下
//    UIModalTransitionStyleFlipHorizontal左右翻转效果
//    UIModalTransitionStyleCrossDissolve 渐变效果
//    UIModalTransitionStylePartialCurl 翻书效果
    
    PresentViewController *present = [[PresentViewController alloc] init];
    present.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
//    模态，一个视图控制器
    [self presentViewController:present animated:YES completion:nil];
}
//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
//{
//    [self dismissViewControllerAnimated:YES completion:nil];
//}
//- (instancetype)init
//{
//    self = [super init];
//    if (self) {
//        
//    }
//    return self;
//}

//init loadView viewdidload只执行一次
//下述方法会执行多次
//- (void)viewWillAppear:(BOOL)animated{
//    [super viewDidAppear:animated];
//}
//- (void)viewDidAppear:(BOOL)animated
//{
//    [super viewDidAppear:animated];
//}
//- (void)viewWillDisappear:(BOOL)animated
//{
//    [super viewWillDisappear:animated];
//}
//- (void)viewDidDisappear:(BOOL)animated
//{
//    [super viewDidDisappear:animated];
//}

//懒加载
//- (UIView *)subView
//{
//    if (_subView == nil) {
//        _subView = [UIView new];
//        [self loadView];
//    }
//    return _subView;
//}
- (void)didReceiveMemoryWarning {
//    从父类继承来的方法中有内存警告的打印
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
//    释放部分内存资源
//    把未显示在屏幕上的资源置空
}

@end
